
*These globals define paths to use in the other do files
global gsdData = "$swdLocal\Data"
global gsdDo = "$swdLocal\Code\Do"
global gsdBin = "$swdCurl"
global gsdRawTemp = "$swdLocal\Data\0-RawTemp"
global gsdAnalysisOutput = "$swdLocal\Data\AnalysisData"
global gsdTables = "$swdLocal\Tables"

*create folders if needed
capture mkdir "$swdLocal\Data"
capture mkdir "$swdLocal\Data\0-RawTemp"
capture mkdir "$swdLocal\Tables"

* Install ado files
adopath ++ "ado"
sysdir set PLUS "ado"
*-----------------------------*
* Install packages from SSC  *
*-----------------------------*
ssc install ranktest, replace
ssc install qqvalue, replace        // Family-wise adjusted p-values
ssc install spmap, replace          // Visualization of spatial data
ssc install shp2dta, replace        // Converts shape boundary files to Stata datasets
ssc install mif2dta, replace        // Converts MapInfo Interchange Format files to Stata datasets
ssc install coefplot, replace       // Ropeladder coefficients plotting
ssc install winsor2, replace        // Winsorize data
ssc install parmest, replace        // Extract p-values
ssc install catplot, replace        // Categorical plots
ssc install fsum, replace           // Fast summary statistics
ssc install moremata, replace       // Extended matrix functions
ssc install outreg2, replace        // Export regression tables
cap ssc install globdist, replace   // Geographic distance calculation (optional)
ssc install estout, replace       // esttab and eststo

*-----------------------------*
* Install packages from net  *
*-----------------------------*

* ivreg2 (Instrumental variables regression)
net install ivreg2, from(http://fmwww.bc.edu/repec/bocode/i) replace

* tf and vtf (Tools from David Lee's website)
net install tf, force from(http://www.princeton.edu/~davidlee/wp/)

* vtf install to custom folder
cap mkdir "`c(sysdir_plus)'v"
net set other "`c(sysdir_plus)'v"
net install vtf, force from(http://www.princeton.edu/~davidlee/wp/) all

net install sg97_5, from(http://www.stata-journal.com/software/sj12-4/)
